package com.china08.yxyapi.entity.db.res;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Index;
import javax.persistence.Table;

import com.china08.yxyapi.entity.BaseEntityNoId;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * 目录表 添加数据时请手动生成id
 * 
 * @author Json
 *
 */
@Table(name = "yxy_res_book_contents", catalog = "yxy_res", indexes = { @Index(columnList = "pId") })
@Entity
public class YxyResBookContents extends BaseEntityNoId {
    private static final long serialVersionUID = 1L;

    @Id
    @Column(length = 32)
    private String id;

    // 不能根据PId=0来判断他是父节点 有的节点不是父节点 pid也为0
    @JsonProperty(value = "pId")
    @Column(length = 32, nullable = false)
    private String pId;

    @Column(length = 255, nullable = false)
    private String name;

    // 0代表不是 1代表是父节点
    @Column(length = 32, nullable = false)
    private String isParent;

    @Column(length = 255, nullable = false)
    private String bookId;

    // 所有的知识点 逗号分割,
    @Column(length = 500, name = "all_know")
    private String allKnow;
    // 是否是最后一级节点 0不是 1是
    @Column
    private Integer status = 0;

    /**
     * 是否展示，0--不展示 ，1--展示
     */
    @Column(name = "is_view")
    private Integer isView = 1;

    /**
     * 是否修改： 0 不需要 1需要
     */
    @Column(name = "is_update")
    private Integer isUpdate = 0;

    /**
     * 排序字段
     */
    @Column
    private Integer orderNum = 100;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getpId() {
        return pId;
    }

    public void setpId(String pId) {
        this.pId = pId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getIsParent() {
        return isParent;
    }

    public void setIsParent(String isParent) {
        this.isParent = isParent;
    }

    public String getBookId() {
        return bookId;
    }

    public void setBookId(String bookId) {
        this.bookId = bookId;
    }

    public String getAllKnow() {
        return allKnow;
    }

    public void setAllKnow(String allKnow) {
        this.allKnow = allKnow;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Integer getIsView() {
        return isView;
    }

    public void setIsView(Integer isView) {
        this.isView = isView;
    }

    public Integer getOrderNum() {
        return orderNum;
    }

    public void setOrderNum(Integer orderNum) {
        this.orderNum = orderNum;
    }

    public Integer getIsUpdate() {
        return isUpdate;
    }

    public void setIsUpdate(Integer isUpdate) {
        this.isUpdate = isUpdate;
    }

}
